Sound and Decidable Type Inference for Functional Dependencies
نویسندگان
چکیده
Functional dependencies are a popular and useful extension to Haskell style type classes. In this paper, we give a reformulation of functional dependencies in terms of Constraint Handling Rules (CHRs). In previous work, CHRs have been employed for describing user-programmable type extensions in the context of Haskell style type classes. Here, we make use of CHRs to provide for the first time a concise result that under some sufficient conditions, functional dependencies allow for sound and decidable type inference. The sufficient conditions imposed on functional dependencies can be very limiting. We show how to safely relax these conditions.
منابع مشابه
Understanding functional dependencies via constraint handling rules
Functional dependencies are a popular and useful extension to Haskell style type classes. We give a reformulation of functional dependencies in terms of Constraint Handling Rules (CHRs). In previous work, CHRs have been employed for describing user-programmable type extensions in the context of Haskell style type classes. Here, we make use of CHRs to provide for the first time a concise result ...
متن کاملPolynomial Size Analysis with Families of Piecewise Polynomials for Functional Programs over Lists ? With soundness proof and examples in detail
Size analysis can play an important role in optimising memory management and in preventing failure due to memory exhaustion. Static size analysis can be performed using size-aware type systems. In size-aware type systems types express output-on-input size dependencies where sizes of outputs depend on sizes of inputs but they do not depend directly on the actual values. We present a novel type s...
متن کاملar X iv : 0 90 2 . 20 73 v 1 [ cs . L O ] 1 2 Fe b 20 09 POLYNOMIAL SIZE ANALYSIS OF FIRST - ORDER SHAPELY FUNCTIONS
We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be implementations of matrix multiplication and the Cartesian product of two lists. The type system is proved to be sound w.r.t...
متن کاملPolynomial Size Analysis of First-Order Shapely Functions
We present a size-aware type system for first-order shapely function definitions. Here, a function definition is called shapely when the size of the result is determined exactly by a polynomial in the sizes of the arguments. Examples of shapely function definitions may be implementations of matrix multiplication and the Cartesian product of two lists. The type system is proved to be sound w.r.t...
متن کاملThe Complexity of Order Dependency Inference
Dependencies play an important role in database theory. We study order dependencies (ODs)—and unidirectional order dependencies (UODs), sub-class of ODs—which describe the relationships among lexicographical orderings of sets of tuples. We investigate the inference problem for order dependencies. We establish the following: (i) a sound and complete chase procedure for ODs for testing logical im...
متن کامل